import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import("../views/IndexPage"),

  },
  {
    path: "/class/:schoolid/:xueliid",
    name: "sec",
    component: () => import("../views/SecondView")
  },
  {
    path: "/thirds/:schoolid/:xueliid",
    name: "thirds",
    component: () => import("../views/ThirdView")
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/Login")
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/Register")
  },

  {
    path: "/moreArt/:id",
    name: "moreArt",
    component: () => import("../views/ArtListView")
  },

  {
    path: "/artical/:artid/:type",
    name: "artical",
    component: () => import("../views/ArtView")
  },
  {
    path: "/aboutus/:id",
    name: "aboutus",
    component: () => import("../views/AboutUs")
  },
  {   
    path: "/userinfo",
    name: "userinfo",
    component: () => import("../views/UserInfo"),
    children: [
      {
        path: "myclass",
        name: "maclass",
        component: () => import("../views/MyClass")
      },
      {
        path: "zhanglist",
        name: "zhanglist",
        component: () => import("../views/ZhangList")
      },
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
